const {getHttpDetail} = require("../../models/http.js")

Page({
  data: {
    arr:"",
    playState:{}
  },
  onLoad: function (options) {
    let {id} = options
    getHttpDetail({
      id,
      success:res=>{
        var arr = res.data.playlist
        this.setData({
          arr
        })
      }
    })
  },
  handlePlay(event){
    let {id} = event.currentTarget.dataset
    var playState = this.data.playState
    playState[id] = !playState[id]
    for(let key in playState){
      if(key!=id){
        playState[key] = false
      }
    }
    this.setData({
      playState
    })
  }
})